Hi Tom,
The home works fine when i run the c program, I understand what you mean about mach3 it seems to call the cprogram 3 times, is this because my home c program has all the home commands on one page?
Im sure you will come up with a solution.
we can move on to the limit issue when we sort the homing one thing at a time.
Thanks
John
--- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
> Â
> Sorry about that. I sent a response last Saturday and I see it in my "sent" folder but somehow it wasn't posted.
> Â
> here it is again...
> Â
> Â
> Â
> Hi John,
> Â
> Sorry I don't really understand your description. It
*should* stop homing when the switch is activated correct?  But it should not stop because of a limit fault. Regardless of how limits are configured we are disabling limits while homing so I don't understand that comment either.
> Â
> Let's just get Homing C program to work correctly first before trying to use Mach3. As I described previously, Mach3 calls your Home.c program multiple times (once for each axis) so we need to add stuff to the C Program so it only homes the axis that Mach3 is requesting to be homed rather than all of them.
> Â
> Unconnected and unused Inputs will float to random values. This is normal.
> Â
> Regards
> TK
>
> --- On Mon, 6/27/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To:
DynoMotion@yahoogroups.com> Date: Monday, June 27, 2011, 3:07 PM
>
>
> Â
>
>
>
> Hi Tom
> Did you get a chance to look at my request
>
> John
>
> --- In
DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> >
> > Hi Tom
> > That worked perfectly thanks, I have a few more questions.
> > When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
> > Next when I deactivate the limit so everything works in kmotion and home
in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
> > Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.
> >
> > Thanks again
> >
> > John
> >
> > --- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > ÂÂ
> > > ÂÂ
> > > Hi John,
> > > ÂÂ
> > > The C language statement
> > > ÂÂ
> > > while (!ReadBit(10)) ; // loop until IO bit goes high
> >
>
> > > translated to English would be: loop doing nothing while a read of bit 10 is not true.
> > > ÂÂ
> > > The " ! " is the NOT operator. So remove the ! character for a home switch of the opposite polarity.
> > > ÂÂ
> > > ÂÂ
> > > Regarding the A Axis disabled. There was a statement to declare X,Y,Z are used A unused:
> > > ÂÂ
> > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > >
> > > I removed this statement from your Home Program because it should be in your Init program already. Is it? Do you have an Init program?
> > > ÂÂ
> > > Regards
> > > TK
> > > ÂÂ
> > >
> > > --- On Sat, 6/25/11, jonny1bar <john@>
wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To:
DynoMotion@yahoogroups.com> > > Date: Saturday, June 25, 2011, 6:50 AM
> > >
> > >
> > > ÂÂ
> > >
> > >
> > >
> > > Hi Tom,
> > >
> > > Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> > > What is the best way to sort this.
> > > Could we set the loop until IO bit goes high to low somehow.
> > > Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled
wont let me do anything, any ideas.
> > >
> > > Thanks
> > >
> > > John
> > >
> > > --- In
DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > >
> > > > Hi Tom
> > > >
> > > > Ok I will try to work it out
> > > >
> > > > John
> > > >
> > > > --- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > > ÂÂÂ
>
> > > > See Attached
> > > > > ÂÂÂ
> > > > > Software is very expensive :}
> > > > > ÂÂÂ
> > > > > TK
> > > > >
> > > > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To:
DynoMotion@yahoogroups.com> > > > > Date: Friday, June 24, 2011, 1:17 PM
> > > > >
> > > > >
> > > > > ÂÂÂ
> > > > >
> > >
> >
> > > > >
> > > > >
> > > > > Hi Tom
> > > > >
> > > > > Yes I use 1 switch for homeing and limit on each axis.
> > > > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > > > I am new to all this and need all the help I can get.
> > > > > I know of people that can help me but not sure how much it will cost.
> > > > > Thanks
> > > > >
> > > > > John
> > > > > --- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> >
> > > > ÃÆ'‚ÂÂÂ
> > > > > > The error is because you have a line of code to restore the Limit Switch Options but you neverÃÆ'‚ saved the options and a location to save them was never declared.ÃÆ'‚ÂÂÂ
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > Are you using the same switch for homing and a limit?ÃÆ'‚ If you are then you need to:
> > > > > >
> > > > > > #1ÃÆ'‚ declare a place to save the original settings
> > > > > > ÃÆ'‚ ÃÆ'‚ ÃÆ'‚ Add an integer variable (inside the main
function just after the bracket) with
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > ÃÆ'‚ ÃÆ'‚ ÃÆ'‚ int SaveZLimits;
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > #2 save them before homing
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > ÃÆ'‚ ÃÆ'‚ SaveZLimits = ch2->LimitSwitchOptions; //ÃÆ'‚ save original limit settings
> > > > > >
> > > > > > #3 disable the limits
> > > >
> > ÃÆ'‚ÂÂÂ
> > > > > > ch2->LimitSwitchOptions = 0;ÃÆ'‚ // disable limits
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > #4 restore them (after homing)
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > >
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > > >
> ÃÆ'‚ÂÂÂ
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > > Regards
> > > > > > TK
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > >
> > > > > >
> > > > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To:
DynoMotion@yahoogroups.com> > > > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > >
> >
> > > > > >
> > > > > > ÃÆ'‚ÂÂÂ
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi Tom,
> > > > > >
> > > > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > > > If it works can i try it through mach3.
> > > > > > I have just worked out you can run the program from the c screen.
> > > > > > Were so close I can taste it.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > John
> > > > > >
> > > > > > #include "KMotionDef.h"
> > > > > >
>
> > > > > // Configuration and Homing program for a 3 axis System
> > > > > > // Limit switches are disabled and used as a home switch
> > > > > > // then they are re-enabled
> > > > > >
> > > > > > main()
> > > > > > {
> > > > > >
> > > > > >
> > > > > > // enable all 3 axes and begin servoing where we are
> > > > > >
> > > > > > EnableAxis(0);
> > > > > > EnableAxis(1);
> > > > > > EnableAxis(2);
> > > > > >
> > > > > > // Home Z up first - jog until it sees the limit
> > > > > >
> > > > > > Jog(2,100); // jog slowly positive
> > > > > > while (!ReadBit(10)) ; // loop until IO
bit goes high
> > > > > > Jog(2,0); // stop
> > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > DisableAxis(2); // disable the axis
> > > > > > Zero(2); // Zero the position
> > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > >
> > > > > > // Home X next - jog until it sees the limit
> > > > > >
> > > > > > Jog(0,-100); // jog slowly negative
> > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > >
> > Jog(0,0); // stop
> > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > DisableAxis(0); // disable the axis
> > > > > > Zero(0); // Zero the position
> > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > >
> > > > > > // Home Y next - jog until it sees the limit
> > > > > >
> > > > > > Jog(1,-100); // jog slowly negative
> > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > Jog(1,0); // stop
> >
> > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > DisableAxis(1); // disable the axis
> > > > > > Zero(1); // Zero the position
> > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > >
> > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > }
> > > > > >
> > > > > > --- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > The code looks reasonable to me.ÃÆ'Æ'‚ÃÆ'‚ But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > For Mach3 each axis is homed separately.ÃÆ'Æ'‚ÃÆ'‚ The Ref All Home
button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'Æ'‚ÃÆ'‚ Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'Æ'‚ÃÆ'‚ If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > > >
ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'Æ'‚ÃÆ'‚ Which is the Jog, wait for switch, stop.ÃÆ'Æ'‚ÃÆ'‚ See if that works.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > Regards,
> > > > > > > TK
> > > > > > >
> > > > > > >
> > > > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
>
> > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To:
DynoMotion@yahoogroups.com> > > > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Tom,
> > > > > > >
> > > > > > > I have managed to link up a limit switch for testing on z axis, Z
homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > > > >
> > > > > > > Can you also have a quick look at axis C code
> > > > > > >
> > > > > > > #include "KMotionDef.h"
> > > > > > >
> > > > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > > > // enables them
> > > >
> > > // sets them as an xyz coordinate system for GCode
> > > > > > >
> > > > > > > int main()
> > > > > > > {
> > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > ch0->Vel=40000;
> > > > > > > ch0->Accel=400000;
> > > > > > > ch0->Jerk=4000000;
> > > > > > > ch0->P=0;
> > > > > > > ch0->I=0.009999999776483;
> > > > > > > ch0->D=0;
> > > > > > > ch0->FFAccel=0;
> > > > > > > ch0->FFVel=0;
> > > > > > > ch0->MaxI=200;
> > > > > > > ch0->MaxErr=1000000;
> > > > > > >
ch0->MaxOutput=200;
> > > > > > > ch0->DeadBandGain=1;
> > > > > > > ch0->DeadBandRange=0;
> > > > > > > ch0->InputChan0=2;
> > > > > > > ch0->InputChan1=0;
> > > > > > > ch0->OutputChan0=2;
> > > > > > > ch0->OutputChan1=0;
> > > > > > > ch0->MasterAxis=-1;
> > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > ch0->InputGain0=1;
> > > > > > > ch0->InputGain1=1;
> > > > > > > ch0->InputOffset0=0;
> > > > > > > ch0->InputOffset1=0;
> > > > > > > ch0->OutputGain=1;
> > > > > > > ch0->OutputOffset=0;
> > > > > > > ch0->SlaveGain=1;
> > >
> > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > ch0->BacklashAmount=0;
> > > > > > > ch0->BacklashRate=0;
> > > > > > > ch0->invDistPerCycle=1;
> > > > > > > ch0->Lead=0;
> > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > ch0->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch0->iir[0].B0=1;
> > > > > > > ch0->iir[0].B1=0;
> > > > > > > ch0->iir[0].B2=0;
> > > > > > > ch0->iir[0].A1=0;
> > > > > > > ch0->iir[0].A2=0;
> > > > > > >
> > > > > > > ch0->iir[1].B0=1;
> > > > > > > ch0->iir[1].B1=0;
> > > > > >
> ch0->iir[1].B2=0;
> > > > > > > ch0->iir[1].A1=0;
> > > > > > > ch0->iir[1].A2=0;
> > > > > > >
> > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > EnableAxisDest(0,0);
> > > > > > >
> > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > ch1->Vel=40000;
> > > > > > > ch1->Accel=400000;
> > > > > > >
ch1->Jerk=4000000;
> > > > > > > ch1->P=0;
> > > > > > > ch1->I=0.009999999776483;
> > > > > > > ch1->D=0;
> > > > > > > ch1->FFAccel=0;
> > > > > > > ch1->FFVel=0;
> > > > > > > ch1->MaxI=200;
> > > > > > > ch1->MaxErr=1000000;
> > > > > > > ch1->MaxOutput=200;
> > > > > > > ch1->DeadBandGain=1;
> > > > > > > ch1->DeadBandRange=0;
> > > > > > > ch1->InputChan0=2;
> > > > > > > ch1->InputChan1=0;
> > > > > > > ch1->OutputChan0=2;
> > > > > > > ch1->OutputChan1=0;
> > > > > > > ch1->MasterAxis=-1;
> > > > > > >
ch1->LimitSwitchOptions=0x0;
> > > > > > > ch1->InputGain0=1;
> > > > > > > ch1->InputGain1=1;
> > > > > > > ch1->InputOffset0=0;
> > > > > > > ch1->InputOffset1=0;
> > > > > > > ch1->OutputGain=1;
> > > > > > > ch1->OutputOffset=0;
> > > > > > > ch1->SlaveGain=1;
> > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > ch1->BacklashAmount=0;
> > > > > > > ch1->BacklashRate=0;
> > > > > > > ch1->invDistPerCycle=1;
> > > > > > > ch1->Lead=0;
> > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > ch1->StepperAmplitude=20;
> > > > > > >
>
> > > > > > ch1->iir[0].B0=1;
> > > > > > > ch1->iir[0].B1=0;
> > > > > > > ch1->iir[0].B2=0;
> > > > > > > ch1->iir[0].A1=0;
> > > > > > > ch1->iir[0].A2=0;
> > > > > > >
> > > > > > > ch1->iir[1].B0=1;
> > > > > > > ch1->iir[1].B1=0;
> > > > > > > ch1->iir[1].B2=0;
> > > > > > > ch1->iir[1].A1=0;
> > > > > > > ch1->iir[1].A2=0;
> > > > > > >
> > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > ch1->iir[2].A1=1.920809984207;
>
> > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > EnableAxisDest(1,0);
> > > > > > >
> > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > ch2->Vel=40000;
> > > > > > > ch2->Accel=400000;
> > > > > > > ch2->Jerk=4000000;
> > > > > > > ch2->P=0;
> > > > > > > ch2->I=0.009999999776483;
> > > > > > > ch2->D=0;
> > > > > > > ch2->FFAccel=0;
> > > > > > > ch2->FFVel=0;
> > > > > > > ch2->MaxI=200;
> > > > > > > ch2->MaxErr=1000000;
> > > > > > > ch2->MaxOutput=200;
> > > >
> > > ch2->DeadBandGain=1;
> > > > > > > ch2->DeadBandRange=0;
> > > > > > > ch2->InputChan0=0;
> > > > > > > ch2->InputChan1=0;
> > > > > > > ch2->OutputChan0=0;
> > > > > > > ch2->OutputChan1=0;
> > > > > > > ch2->MasterAxis=-1;
> > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > ch2->InputGain0=1;
> > > > > > > ch2->InputGain1=1;
> > > > > > > ch2->InputOffset0=0;
> > > > > > > ch2->InputOffset1=0;
> > > > > > > ch2->OutputGain=1;
> > > > > > > ch2->OutputOffset=0;
> > > > > > > ch2->SlaveGain=1;
> > > > > > >
ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > ch2->BacklashAmount=0;
> > > > > > > ch2->BacklashRate=0;
> > > > > > > ch2->invDistPerCycle=1;
> > > > > > > ch2->Lead=0;
> > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > ch2->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch2->iir[0].B0=1;
> > > > > > > ch2->iir[0].B1=0;
> > > > > > > ch2->iir[0].B2=0;
> > > > > > > ch2->iir[0].A1=0;
> > > > > > > ch2->iir[0].A2=0;
> > > > > > >
> > > > > > > ch2->iir[1].B0=1;
> > > > > > > ch2->iir[1].B1=0;
> > > > > > >
ch2->iir[1].B2=0;
> > > > > > > ch2->iir[1].A1=0;
> > > > > > > ch2->iir[1].A2=0;
> > > > > > >
> > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > EnableAxisDest(2,0);
> > > > > > >
> > > > > > > DefineCoordSystem(0,1,2,-1);
> > > > > > >
> > > > > > > return 0;
> > > > > > > }
> > > > > > >
> > > > > > > And this is the one for the home
switches.
> > > > > > >
> > > > > > > #include "KMotionDef.h"
> > > > > > >
> > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > // then they are re-enabled
> > > > > > >
> > > > > > > main()
> > > > > > > {
> > > > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > > > >
> > > > > > > DisableAxis(0); // Disable all axes
> > > > > > > DisableAxis(1);
> > > > > > > DisableAxis(2);
> > > > > > >
> > > > > > > // Set the axis
parameters here
> > > > > > > // after everything is configured in the KMotion Screens
> > > > > > > // use copy C Code to clipboard on the configuration screen
> > > > > > > // then paste here. Repeat for each axis
> > > > > > >
> > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > ch0->Vel=40000;
> > > > > > > ch0->Accel=400000;
> > > > > > > ch0->Jerk=4000000;
> > > > > > > ch0->P=0;
> > > > > > > ch0->I=0.009999999776483;
> > > > > > > ch0->D=0;
> > > > > > > ch0->FFAccel=0;
> > > > > > > ch0->FFVel=0;
> > > > > > >
ch0->MaxI=200;
> > > > > > > ch0->MaxErr=1000000;
> > > > > > > ch0->MaxOutput=200;
> > > > > > > ch0->DeadBandGain=1;
> > > > > > > ch0->DeadBandRange=0;
> > > > > > > ch0->InputChan0=2;
> > > > > > > ch0->InputChan1=0;
> > > > > > > ch0->OutputChan0=2;
> > > > > > > ch0->OutputChan1=0;
> > > > > > > ch0->MasterAxis=-1;
> > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > ch0->InputGain0=1;
> > > > > > > ch0->InputGain1=1;
> > > > > > > ch0->InputOffset0=0;
> > > > > > > ch0->InputOffset1=0;
> > > > > > > ch0->OutputGain=1;
> > > >
> > > ch0->OutputOffset=0;
> > > > > > > ch0->SlaveGain=1;
> > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > ch0->BacklashAmount=0;
> > > > > > > ch0->BacklashRate=0;
> > > > > > > ch0->invDistPerCycle=1;
> > > > > > > ch0->Lead=0;
> > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > ch0->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch0->iir[0].B0=1;
> > > > > > > ch0->iir[0].B1=0;
> > > > > > > ch0->iir[0].B2=0;
> > > > > > > ch0->iir[0].A1=0;
> > > > > > > ch0->iir[0].A2=0;
> > > > > > >
> > > > > >
> ch0->iir[1].B0=1;
> > > > > > > ch0->iir[1].B1=0;
> > > > > > > ch0->iir[1].B2=0;
> > > > > > > ch0->iir[1].A1=0;
> > > > > > > ch0->iir[1].A2=0;
> > > > > > >
> > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > >
> > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > ch1->Vel=40000;
> > > > > > >
ch1->Accel=400000;
> > > > > > > ch1->Jerk=4000000;
> > > > > > > ch1->P=0;
> > > > > > > ch1->I=0.009999999776483;
> > > > > > > ch1->D=0;
> > > > > > > ch1->FFAccel=0;
> > > > > > > ch1->FFVel=0;
> > > > > > > ch1->MaxI=200;
> > > > > > > ch1->MaxErr=1000000;
> > > > > > > ch1->MaxOutput=200;
> > > > > > > ch1->DeadBandGain=1;
> > > > > > > ch1->DeadBandRange=0;
> > > > > > > ch1->InputChan0=2;
> > > > > > > ch1->InputChan1=0;
> > > > > > > ch1->OutputChan0=2;
> > > > > > > ch1->OutputChan1=0;
> > > > > > >
ch1->MasterAxis=-1;
> > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > ch1->InputGain0=1;
> > > > > > > ch1->InputGain1=1;
> > > > > > > ch1->InputOffset0=0;
> > > > > > > ch1->InputOffset1=0;
> > > > > > > ch1->OutputGain=1;
> > > > > > > ch1->OutputOffset=0;
> > > > > > > ch1->SlaveGain=1;
> > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > ch1->BacklashAmount=0;
> > > > > > > ch1->BacklashRate=0;
> > > > > > > ch1->invDistPerCycle=1;
> > > > > > > ch1->Lead=0;
> > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > >
ch1->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch1->iir[0].B0=1;
> > > > > > > ch1->iir[0].B1=0;
> > > > > > > ch1->iir[0].B2=0;
> > > > > > > ch1->iir[0].A1=0;
> > > > > > > ch1->iir[0].A2=0;
> > > > > > >
> > > > > > > ch1->iir[1].B0=1;
> > > > > > > ch1->iir[1].B1=0;
> > > > > > > ch1->iir[1].B2=0;
> > > > > > > ch1->iir[1].A1=0;
> > > > > > > ch1->iir[1].A2=0;
> > > > > > >
> > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > >
ch1->iir[2].B2=0.0007689999765716;
> > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > >
> > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > ch2->Vel=40000;
> > > > > > > ch2->Accel=400000;
> > > > > > > ch2->Jerk=4000000;
> > > > > > > ch2->P=0;
> > > > > > > ch2->I=0.009999999776483;
> > > > > > > ch2->D=0;
> > > > > > > ch2->FFAccel=0;
> > > > > > > ch2->FFVel=0;
> > > > > > > ch2->MaxI=200;
> > > > > > > ch2->MaxErr=1000000;
> > > >
> > > ch2->MaxOutput=200;
> > > > > > > ch2->DeadBandGain=1;
> > > > > > > ch2->DeadBandRange=0;
> > > > > > > ch2->InputChan0=0;
> > > > > > > ch2->InputChan1=0;
> > > > > > > ch2->OutputChan0=0;
> > > > > > > ch2->OutputChan1=0;
> > > > > > > ch2->MasterAxis=-1;
> > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > ch2->InputGain0=1;
> > > > > > > ch2->InputGain1=1;
> > > > > > > ch2->InputOffset0=0;
> > > > > > > ch2->InputOffset1=0;
> > > > > > > ch2->OutputGain=1;
> > > > > > > ch2->OutputOffset=0;
> > > > > > >
ch2->SlaveGain=1;
> > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > ch2->BacklashAmount=0;
> > > > > > > ch2->BacklashRate=0;
> > > > > > > ch2->invDistPerCycle=1;
> > > > > > > ch2->Lead=0;
> > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > ch2->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch2->iir[0].B0=1;
> > > > > > > ch2->iir[0].B1=0;
> > > > > > > ch2->iir[0].B2=0;
> > > > > > > ch2->iir[0].A1=0;
> > > > > > > ch2->iir[0].A2=0;
> > > > > > >
> > > > > > > ch2->iir[1].B0=1;
> > > > > > >
ch2->iir[1].B1=0;
> > > > > > > ch2->iir[1].B2=0;
> > > > > > > ch2->iir[1].A1=0;
> > > > > > > ch2->iir[1].A2=0;
> > > > > > >
> > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > // disable the limits (first save how they were set)
> > > > > > > SaveXLimits =
ch0->LimitSwitchOptions;
> > > > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > > > ch0->LimitSwitchOptions = 0;
> > > > > > > ch1->LimitSwitchOptions = 0;
> > > > > > > ch2->LimitSwitchOptions = 0;
> > > > > > >
> > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > >
> > > > > > > EnableAxis(0);
> > > > > > > EnableAxis(1);
> > > > > > > EnableAxis(2);
> > > > > > >
> > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(2,100); // jog slowly
positive
> > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > Jog(2,0); // stop
> > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > DisableAxis(2); // disable the axis
> > > > > > > Zero(2); // Zero the position
> > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > >
> > > > > > > // Home X next - jog until it sees the limit
> > > > > > >
> > > > > > >
Jog(0,-100); // jog slowly negative
> > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > Jog(0,0); // stop
> > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > DisableAxis(0); // disable the axis
> > > > > > > Zero(0); // Zero the position
> > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > >
> > > > > > > // Home Y next - jog until it sees the limit
> > > > > > >
> >
> > > > > Jog(1,-100); // jog slowly negative
> > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > Jog(1,0); // stop
> > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > DisableAxis(1); // disable the axis
> > > > > > > Zero(1); // Zero the position
> > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > >
> > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
>
> > > > > > }
> > > > > > >
> > > > > > > Thanks for all your help
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > --- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > Let's
see:ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ at 160 steps/mm x 10000mm/minÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ xÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 1mm /ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > > > >
ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ Most Stepper motors have very limited torque beyond that step rate.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > >
> > > > > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not
Mach3.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ Then test if the input toggles properly using the Digital I/O
Screen.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ Set the corresponding input bits and polarities and select that KFLOP should watch the limit.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ Use the "Disallow drive into limit" mode.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
All this information is packed into a 32bit hexadecimal
> LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ But yes it can drive steppers, brushless, or brush motors.
> > > > > > > >
ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > >
> > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To:
DynoMotion@yahoogroups.com> > > > > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi TK
> > > > > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > > > > Settings are 10mm pitch
ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > > > > What is the max I can run?(I'm a speed demon)
> > > > > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > > > > Thanks again
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > --- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > >
ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > > That's good progress.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > > Yes if everything is the
same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install
directory.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > >
> The indicated Home Inputs are just recommendations.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ If your sensor
outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ Or put a 100 ohm resistor in series.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > >
> > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ Maybe you have one already?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ There is a C example called PWM1KHz.c
that you can do basic testing to see if it works.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > > Regards
> > > > > > > > > TK
> > > > > > > > >
ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > To:
DynoMotion@yahoogroups.com> > > > > > > > > Date: Monday, June 20, 2011, 4:08 AM
(Message over 64 KB, truncated)